<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/business/inductionfurnace/InductionFurnacePD.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/business/inductionfurnace/InductionFurnacePD.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '生产明细',
                name: 'inductionfurnace/InductionFurnacePD',
                url: "/InductionFurnacePD/",
                sortName: "CreateDate",
                foreignKey:null
            });
            const editFormFields = ref({"HeatNo":"","HeatName":"","ProductName":"","BatchNumber":"","MaterialWeight":"","Output":"","RequiredWeight":"","StartTime":"","EndTime":"","State":""});
            const editFormOptions = ref([[{"title":"炉号","field":"HeatNo"},
                               {"title":"名称","field":"HeatName"},
                               {"title":"产品名称","field":"ProductName"}],
                              [{"title":"批次号","field":"BatchNumber"},
                               {"title":"投入物料量","field":"MaterialWeight","type":"decimal"},
                               {"title":"实际产量","field":"Output","type":"decimal"}],
                              [{"title":"开炉时间","field":"StartTime"},
                               {"title":"结束时间","field":"EndTime"},
                               {"title":"需求重量","required":true,"field":"RequiredWeight","type":"decimal"}],
                              [{"dataKey":"生产明细_状态","data":[],"title":"状态","field":"State","type":"select"}]]);
            const searchFormFields = ref({"HeatNo":"","HeatName":"","OrderFormNo":"","ProductName":"","BatchNumber":"","StartTime":""});
            const searchFormOptions = ref([[{"title":"炉号","field":"HeatNo"},{"title":"名称","field":"HeatName"},{"title":"订单号","field":"OrderFormNo"}],[{"title":"产品名称","field":"ProductName"},{"title":"批次号","field":"BatchNumber"},{"title":"开炉时间","field":"StartTime","type":"datetime"}]]);
            const columns = ref([{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'HeatId',title:'炉号ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'HeatNo',title:'炉号',type:'string',width:70,align:'left',sort:true},
                       {field:'HeatName',title:'名称',type:'string',width:70,align:'left'},
                       {field:'OrderFormNo',title:'订单号',type:'string',link:true,width:130,align:'left'},
                       {field:'Heat',title:'炉次号',type:'int',width:80,require:true,align:'left'},
                       {field:'LocalBatchNumber',title:'本地批次号',type:'string',width:110,require:true,align:'left'},
                       {field:'ProductName',title:'产品名称',type:'string',width:90,align:'left'},
                       {field:'BatchNumber',title:'批次号',type:'string',width:80,align:'left'},
                       {field:'MaterialWeight',title:'投入物料量',type:'decimal',width:80,align:'left'},
                       {field:'Output',title:'实际产量',type:'decimal',width:80,align:'left'},
                       {field:'RequiredWeight',title:'需求重量',type:'decimal',width:80,require:true,align:'left'},
                       {field:'StartTime',title:'开炉时间',type:'string',width:90,align:'left'},
                       {field:'EndTime',title:'结束时间',type:'string',width:90,align:'left'},
                       {field:'State',title:'状态',type:'int',bind:{ key:'生产明细_状态',data:[]},width:60,align:'left'},
                       {field:'CreateUserName',title:'添加人',type:'string',width:80,align:'left'},
                       {field:'CreateUserId',title:'添加人ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateDate',title:'添加时间',type:'datetime',width:90,align:'left',sort:true},
                       {field:'ModifyUserName',title:'修改人',type:'string',width:80,align:'left'},
                       {field:'ModifyUserId',title:'修改人ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'DeletionFlag',title:'删除标识',type:'int',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
